package com.kedi.journalismcenter.service.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kedi.journalismcenter.read.dao.mapper.ReadGoldenRadioMapper;
import com.kedi.journalismcenter.service.GoldenRadioService;
import com.kedi.journalismcenter.write.dao.mapper.PcGoldenRadioMapper;

/**
 * 
 *
 * @ClassName StorytellingService
 * @author: 陈辽逊
 * @date: 2019/7/13 11:08
 */
@Service
public class GoldenRadioServiceImpImpl implements GoldenRadioService {

	@Autowired
	public ReadGoldenRadioMapper rmapper;
	@Autowired
	public PcGoldenRadioMapper wmapper;
	final static Logger logger = LoggerFactory.getLogger(GoldenRadioServiceImpImpl.class);

	/**
	 * @return 返回查询评书信息
	 */
	@Override
	public List<Map<String, Object>> storytelling(int page,int limit) {
		try {
			List<Map<String, Object>> a = rmapper.storytelling(page,limit);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}

	/**
	 * @return 返回查询戏曲信息
	 */
	@Override
	public List<Map<String, Object>> opera(int page,int limit) {
		try {
			List<Map<String, Object>> a = rmapper.opera(page,limit);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}

	/**
	 * @return 返回查询音乐信息
	 */
	@Override
	public List<Map<String, Object>> music(int page,int limit) {
		try {
			List<Map<String, Object>> a = rmapper.music(page,limit);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}

	/**
	 * @return 返回查询实评信息
	 */
	@Override
	public List<Map<String, Object>> review(int page,int limit) {
		try {
			List<Map<String, Object>> a = rmapper.review(page,limit);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}

	/**
	 * @return 返回创建的评书信息
	 */
	@Override
	public int istorytelling(Map map) {
		try {
			int a = wmapper.istorytelling(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回修改的评书信息
	 */
	@Override
	public int storytelling(Map map) {
		try {
			int a = wmapper.storytelling(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回创建的戏曲信息
	 */
	@Override
	public int iopera(Map map) {
		try {
			int a = wmapper.iopera(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回修改的戏曲信息
	 */
	@Override
	public int opera(Map map) {

		try {
			int a = wmapper.opera(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回创建的音乐信息
	 */
	@Override
	public int imusic(Map map) {
		try {
			int a = wmapper.imusic(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回修改的音乐信息
	 */
	@Override
	public int music(Map map) {
		try {
			int a = wmapper.music(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回创建的评书信息
	 */
	@Override
	public int ireview(Map map) {
		try {
			int a = wmapper.ireview(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return 0;
		}
	}

	/**
	 * @return 返回修改的评书信息
	 */
	@Override
	public int review(Map map) {
		return wmapper.review(map);
	}
}
